package com.ruoyi.shopping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.shopping.domain.MallSwiper;
import com.ruoyi.shopping.mapper.MallSwiperMapper;
import com.ruoyi.shopping.service.IMallSwiperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商城轮播图Service业务层处理
 *
 * @author ruoyi
 * @date 2022-06-17
 */
@Service
public class MallSwiperServiceImpl implements IMallSwiperService
{
    @Autowired
    private MallSwiperMapper mallSwiperMapper;

    /**
     * 查询商城轮播图
     *
     * @param id 商城轮播图主键
     * @return 商城轮播图
     */
    @Override
    public MallSwiper selectMallSwiperById(Long id)
    {
        return mallSwiperMapper.selectMallSwiperById(id);
    }

    /**
     * 查询商城轮播图列表
     *
     * @param mallSwiper 商城轮播图
     * @return 商城轮播图
     */
    @Override
    public List<MallSwiper> selectMallSwiperList(MallSwiper mallSwiper)
    {
        return mallSwiperMapper.selectMallSwiperList(mallSwiper);
    }

    /**
     * 新增商城轮播图
     *
     * @param mallSwiper 商城轮播图
     * @return 结果
     */
    @Override
    public int insertMallSwiper(MallSwiper mallSwiper)
    {
        mallSwiper.setCreateTime(DateUtils.getNowDate());
        return mallSwiperMapper.insertMallSwiper(mallSwiper);
    }

    /**
     * 修改商城轮播图
     *
     * @param mallSwiper 商城轮播图
     * @return 结果
     */
    @Override
    public int updateMallSwiper(MallSwiper mallSwiper)
    {
        mallSwiper.setUpdateTime(DateUtils.getNowDate());
        return mallSwiperMapper.updateMallSwiper(mallSwiper);
    }

    /**
     * 批量删除商城轮播图
     *
     * @param ids 需要删除的商城轮播图主键
     * @return 结果
     */
    @Override
    public int deleteMallSwiperByIds(Long[] ids)
    {
        return mallSwiperMapper.deleteMallSwiperByIds(ids);
    }


    /**
     * 批量逻辑删除商城轮播图
     *
     * @param ids 需要删除的商城轮播图主键
     * @return 结果
     */
    @Override
    public int logicDeleteMallSwiper(Long[] ids,String delType,Long delUser)
    {
        return mallSwiperMapper.logicDeleteMallSwiper(ids,delType,delUser);
    }

    /**
     * 删除商城轮播图信息
     *
     * @param id 商城轮播图主键
     * @return 结果
     */
    @Override
    public int deleteMallSwiperById(Long id)
    {
        return mallSwiperMapper.deleteMallSwiperById(id);
    }
}
